<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>疾病库</title>
    <%@ include file="../common/meta.jsp" %>
    <%@ include file="../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/jquery.qrcode.min.js?t=${now}"></script>
    <script src="${ctx}/js/common/upLoadingFileSize.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js?t=${now}"></script>
    <style>
        .reasonCheckLabel{
            display: block;
        }
        .div-hidden{
            display: none;
        }
    </style>
    <script>
        var searchInfo = ${searchInfo};
        var deptMap = ${deptMap};
    </script>
</head>
<body class="gray-bg">
<div id="vue">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-search"></i> 筛选查询</h5>
                    </div>
                    <div class="ibox-content ibox-content-search">
                        <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">查询疾病：</label>
                                <div class="col-sm-3" >
                                    <input type="text" name="sicknessName" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="sicknessName" class="form-control" value="${not empty searchInfo ? searchInfo.sicknessName : ''}"  placeholder="输入疾病名称" maxlength="30">
                                </div>
                                <div class="ibox-tools ibox-tools-search">
                                    <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                                    <button type="button" class="btn btn-primary btn-outline" onclick="openSearchTools();"><i class="fa fa-caret-down"></i></button>
                                </div>
                            </div>
                            <div class="search-tools">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">所属一级科室：</label>
                                    <div class="col-sm-3">
                                        <select class="form-control" name="oneLevelDeptCode" id="oneLevelDeptCode" onchange="getTwoDeptInfoList(this.value)">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${deptMap}" var="item">
                                                <option value="${item.key}" ${not empty searchInfo.oneLevelDeptCode && searchInfo.oneLevelDeptCode == item.key ? 'selected' : '' }>${item.value}</option>
                                            </c:forEach>
                                        </select>
                                    </div>

                                    <label class="col-sm-1 control-label">所属二级科室：</label>
                                    <div class="col-sm-3">
                                        <select class="form-control" name="twoLevelDeptCode" id="twoLevelDeptCode" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${deptTwoMap}" var="item">
                                                <option value="${item.key}" ${not empty searchInfo.twoLevelDeptCode && searchInfo.twoLevelDeptCode == item.key ? 'selected' : '' }>${item.value}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-table"></i> 疾病信息库</h5>
                        <div class="ibox-tools col-sm-offset-2">
                            <c:if test="${userType == 'super' || not empty btnMap['addSick']}">
                                <button class="btn btn-primary btn-outline" onclick="openAddSickPage()">新增</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['editSick']}">
                                <button class="btn btn-primary btn-outline" onclick="openEditSickPage()">编辑</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['delSick']}">
                                <button class="btn btn-primary btn-outline" onclick="checkSickDelete()">删除</button>
                            </c:if>
                            <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                            <c:if test="${userType == 'super' || not empty btnMap['importSick']}">
                                <button class="btn btn-primary btn-outline" onclick="doImport()">导入</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['exportSick']}">
                                <button class="btn btn-primary btn-outline" onclick="doExport()">导出</button>
                            </c:if>

                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class='table table-striped table-hover'
                               id="dataTable1"  data-height="400"
                               data-toggle="table"
                               data-url="${ctx}/basicSicknessInfo/pageFindSicknessData?t=${now}"
                               data-pagination="true"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type=""
                               data-query-params="getParams"
                               data-cache="false"
                               data-page-number="${not empty searchInfo.pageNo ? searchInfo.pageNo : 1}"
                               data-page-size="${defaultPageSize}"
                               data-page-list="${pageList}">
                            <thead>
                            <tr>
                                <th data-field="id" data-visible="false">主键ID</th>
                                <th data-field="sicknessCode" data-align="center" data-width="120px">平台疾病编码</th>
                                <th data-field="idctenCode" data-align="center" data-width="120px">ICD-10编码</th>
                                <th data-field="sicknessName"  data-align="center" data-width="200px">疾病名称</th>
                                <th data-field="shortName"  data-align="center" data-width="100px">疾病简称</th>
                                <th data-field="alias"  data-align="center" data-width="200px">疾病别称</th>
                                <th data-field="deptName"   data-align="center" data-width="100px">所属二级科室</th>
                                <th data-field="symptom" data-align="center" data-width="150px">疾病症状</th>
                                <th data-field="source" data-align="center" data-width="120px">内容来源</th>
                                <th data-field="sortNum" data-align="center" data-width="80px">排序</th>
                                <th data-field="pvTotal" data-align="center" data-width="80px">浏览量</th>
                                <th data-field="creator" data-align="center" data-formatter="formatterCreator"  data-width="100px">创建人</th>
                                <th data-field="operator" data-align="center" data-formatter="formatterOperator"  data-width="100px">操作人</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="text-center">${companyName}</div>
            </div>
        </div>
    </div>
</div>

<div id="importPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <h4><span id="_importTitle">导入疾病信息</span></h4>
            </div>
            <div class="modal-body modal-body-height modal-body-height-new " id="_ImportExcelDiv">
                <div class="row">
                    <form class="form-horizontal m-t" id="dataForm">
                        <div class="form-group">
                            <div class="col-sm-12">
                                <label class="ui-upload disable-color-style margin-style" id="_chooseFile">浏览<input type="file" id="excelData" name="excelData" style="display: none;" onchange="fileChangeEvent(this)"/></label>
                                <button class="btn btn-white" onclick="downTemplate()">下载疾病模板</button>
                                <span>只支持导入Excel文件，文件大小不超过2MB</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-12">
                                <label class="control-label" id="fileName"></label>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="row div-hidden" id="_errorTipDiv">
                    <div class="col-sm-12" style="padding: 0px;">
                        <label class="control-label" id="_importTip"></label>
                        <div class="ibox float-e-margins">
                            <div class="ibox-content none-border"  style="padding:0px 0px 20px 0px;">
                                <table class='table table-striped table-hover'
                                       id="errorTable"
                                       data-toggle="table"
                                       data-striped="true"
                                       data-response-handler="handleServerResult"
                                       data-page-size="${defaultPageSize}"
                                       data-page-list="${pageList}">
                                    <thead>
                                    <tr>
                                        <th data-field="index" data-align="center" data-width="90px">行数</th>
                                        <th data-field="reason" data-align="left">错误提示</th>
                                    </tr>
                                    </thead>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: right;">
                <button type="button" class="btn btn-primary" onclick="doImportSickExcel()">导入</button>
                <button class="btn btn-white" onclick="$('#importPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/sickness/sicknessMgr.js?t=${now}"></script>
</body>
</html>

